#!/bin/sh -e

export DESTDIR="$1"

pkg-config --exists libudev || {
    printf 'udev (or libudev-zero) is required\n'
    exit 1
}

meson \
    --prefix=/usr \
    --sysconfdir=/etc \
    --mandir=/usr/share/man \
    --libexecdir=/usr/lib \
    -Ddebug-gui=false \
    -Ddocumentation=false \
    -Dtests=false \
    -Dlibwacom=false \
    -Dudev="${udev:=true}" \
    . output

ninja -C output
ninja -C output install
